package leetcode.code2180;

public class Solution {
	public int countEven(int num) {
		int ans = 0;
		for (int i = 2; i <= num; i++) {
			int n = i, s = 0;
			while (n > 0) {
				s += n % 10;
				n /= 10;
			}
			if ((s & 1) == 0) {
				ans++;
			}
		}
		return ans;
	}
}
